Skip to main content

All Questions

3votes
2answers
497views

Enforcing the way of object construction in interface a good practise or not?

As far as I understood it is already not possible languages like Java, C# etc. Because the method name of defining constructor in these languages must be same with the class name. That because I'll ...
FZE's user avatar
  • 459
13votes
3answers
6kviews

Composition over inheritance but

I'm trying to teach myself software engineering and coming up against some conflicting information which is confusing me. I've been learning OOP and what abstract classes / Interfaces are and how to ...
MikeMason's user avatar
2votes
2answers
527views

Lesser of two evils regarding return types

I'm implementing a system in PHP where values are represented with objects that implement an Amount interface. I'm building two different implementations of this interface, one using a simple integer ...
GordonM's user avatar
  • 6,515
3votes
1answer
233views

Interface hierarchy design for separate domains

There are businesses and people. People could be liked and businesses could be commented on: class Like class Comment class Person implements iLikeTarget class Business implements iCommentTarget ...
Hossein Jazayeri's user avatar
5votes
4answers
3kviews

Which methods should be put in an interface and which in abstract classes?

I have seen many frameworks and modules and their standard they follow is like this UserInterface which have some predefined methods AbstractUserClass which implements userInterface Then ...
user26's user avatar
34votes
11answers
21kviews

Why does PHP have interfaces?

I noticed that as of PHP5, interfaces have been added to the language. However, since PHP is so loosely typed, it seems that most of the benefits of using interfaces is lost. Why is this included in ...
GSto's user avatar
  • 8,541

close